#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
int p1,p2,p3;
int a,b,c;
int main()
{
	int n;
	cin >> n;
	double x,y;
	int p;
	double d;
	double ret = 0;
	while(n--)
	{
		cin >> x >> y >> p;
		d=sqrt(x*x+y*y);
		ret += (d/50)*2 +1.5*p;
		
		
		
	}
	if(ret - int(ret) > 0)
	{
		cout << int(ret+1);
	}
	else
	cout << int(ret);
	

}

